{% extends "master.html" %}

{% block scripts %}
    <script src="/public/scripts/ViewGroups.js"></script>
{% endblock %}

{% block breadcrumb %}
  <!--<span id="moderator">
  {% if super_user %}
    <a href="/moderators"> Add Moderators </a>
  {% endif %}
  </span>-->
  
    <ul id="breadcrumb">
        <li><a href="/group/" title="Home"><img src="/public/images/home.png" alt="Home" class="home" /></a></li>
    </ul>
{% endblock %}
{% block content %}
{% if welcome %}
<div id="welcome">Welcome. I see this is your fist time visiting. Would you like to customize your profile right now? <a href="/customize/{{user.key.id}}" id="yescustomize">Yes</a><span id="nocustomize">No</span></div>
{% endif %}
<br>
<h1 class="headlineText">Groups </h1>

{% if super_user %}
  <div class="new">
  	  <a href="/moderators" class="button"><span>
      <img src="/public/images/plus.png" width="13" height="13" /> Moderator</span></a>
      &nbsp;&nbsp;
      <a href="/newgroup/" class="button"><span>
      <img src="/public/images/plus.png" width="13" height="13" /> Group</span></a>
  </div>
{% endif %}

{% for g in groups %}
<div class="group">
    <a href="/group/{{g.group.key.id}}"><h3>{{ g.group.title }}</h3></a>
    <div class="numTopics">
        {{g.count}} topics
        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
        
        {% if moderator %}
           <a href="/modifygroup/{{g.group.key.id}}" class="options">
             Modify
           </a>
           <a href="/deletegroup/{{g.group.key.id}}" class="options">
              Delete
           </a>
        {% endif %}
       
    </div>
</div>
{% endfor %}

{% endblock %}
